<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>搜索结果</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}">
</head>
<style>
    /* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基本布局 */
body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.main-content {
    padding: 20px;
}

/* 导航栏样式 */
.navbar {
    background-color: #333;
    color: #fff;
    padding: 1rem 0;
}

.navbar .logo a {
    color: #fff;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
}

.navbar nav ul {
    list-style: none;
    display: flex;
    justify-content: space-around;
}

.navbar nav ul li a {
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 1rem;
}

.search-bar {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.search-bar input {
    padding: 0.5rem;
    border: none;
    border-radius: 5px;
    margin-right: 10px;
}

.search-bar button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    background-color: #ff6b6b;
    color: #fff;
    cursor: pointer;
}

/* 搜索结果样式 */
.search-results {
    margin-top: 20px;
}

.result-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.result-tab {
    padding: 10px 20px;
    cursor: pointer;
    border: 1px solid #ccc;
    margin: 0 5px;
}

.result-tab.active {
    background-color: #ff6b6b;
    color: #fff;
}

.result-section {
    margin-bottom: 40px;
}

.result-section h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.result-list {
    list-style: none;
    padding: 0;
}

.result-item {
    display: grid;
    grid-template-columns: 2fr 2fr 2fr 1fr 1fr;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* 添加过渡效果 */
}

.result-item:hover {
    transform: translateY(-5px); /* 浮动效果 */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* 阴影效果 */
}

.result-item div {
    text-align: center;
}

.songlist__header {
    display: grid;
    grid-template-columns: 2fr 2fr 2fr 1fr 1fr;
    padding: 10px 0;
    border-bottom: 1px solid #ccc;
    text-align: center;
}

.songlist__header li {
    font-weight: bold;
}

.result-section {
    display: none;
}

.result-section.active {
    display: block;
}

.result-section {
    display: none;
}

.result-section.active {
    display: block;
}

/* 页脚样式 */
.footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 1rem 0;
    margin-top: 2rem;
}

#music-player {
    display: none; /* 初始状态隐藏 */
    width: 100%;
    height: 100px;
    background-color: #f3f3f3;
    position: fixed;
    bottom: 0;
    left: 0;
    border-top: 1px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    opacity: 0; /* 初始透明度 */
    transition: opacity 0.5s ease-in-out; /* 渐变显示效果 */
}

.album-cover {
    width: 60px;
    height: 60px;
    border-radius: 5px;
}

.song-info {
    display: flex;
    flex-direction: column;
    margin-left: 10px;
    flex-grow: 1;
}

#song-name, #singer-name {
    font-size: 14px;
    margin: 2px 0;
}

.controls {
    display: flex;
    align-items: center;
    margin-left: 20px;
}

.control-button {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    margin: 0 10px;
    color: #333;
}

.time-container {
    display: flex;
    align-items: center;
    width: 100%;
    justify-content: space-between;
}

#progress-bar {
    width: 80%;
    margin: 0 10px;
}

#current-lyric {
    position: absolute; /* 固定在播放器区域内 */
    bottom: 70px; /* 固定在进度条上方 */
    width: 100%;
    text-align: center;
    font-size: 14px;
    color: #333;
    transition: opacity 0.5s;
}

.control-button:focus {
    outline: none;
}

.time, .volume, .play-mode, .lyrics {
    margin-left: 20px;
    font-size: 14px;
    color: #333;
}

.progress {
    flex-grow: 1;
    margin: 0 20px;
}

#progress-bar {
    width: 100%;
}

#current-time, #total-time {
    font-size: 14px;
}

.volume input[type="range"] {
    vertical-align: middle;
}

#play-mode {
    cursor: pointer;
}

#lyrics-button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

#lyrics-modal {
    display: none;
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -20%);
    background-color: #fff;
    border: 1px solid #ccc;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

#close-lyrics {
    cursor: pointer;
    font-size: 14px;
    color: #333;
    text-align: right;
}

#lyrics-content {
    margin-top: 10px;
    max-height: 300px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.5;
}
</style>
<body>
    <!-- 导航栏 -->
    <header class="navbar">
        <div class="container">
            <div class="logo">
                <a href="#">Music Website</a>
            </div>
            <nav>
               <ul>
                        <li><a href="{{ url_for('index') }}">首页</a></li>
                        <li><a href="#">发现</a></li>
                        <li><a href="{{ url_for('singer_page') }}">歌手</a></li>
                        <li><a href="#">排行榜</a></li>
                        <li><a href="#">我的音乐</a></li>
                    </ul>

            </nav>
            <div class="search-bar">
                <input type="text" id="searchInput" placeholder="搜索歌曲、专辑、MV">
                <button id="searchButton">搜索</button>
            </div>
        </div>
    </header>

    <main>
        <div class="result-tabs">
            <div class="result-tab active" data-target="songResults">单曲</div>
            <div class="result-tab" data-target="albumResults">专辑</div>
            <div class="result-tab" data-target="mvResults">MV</div>
        </div>

        <!-- 单曲结果 -->
        <section id="songResults" class="result-section active">
            <h3>单曲</h3>
            <ul class="songlist__header">
                <li class="songlist__header_name">歌曲</li>
                <li class="songlist__header_author">歌手</li>
                <li class="songlist__header_album">专辑</li>
                <li class="songlist__header_time">时长</li>
            </ul>
            <ul class="result-list">
                <!-- 单曲结果项 -->
            </ul>
        </section>

        <!-- 专辑结果 -->
        <section id="albumResults" class="result-section">
            <h3>专辑</h3>
            <ul class="result-list">
                <!-- 专辑结果项 -->
            </ul>
        </section>

        <!-- MV结果 -->
        <section id="mvResults" class="result-section">
            <h3>MV</h3>
            <div class="result-list">
                <!-- MV结果项 -->
            </div>
        </section>
    </main>

    <!-- 音乐播放器 -->
    <div id="music-player">
        <img id="album-cover" class="album-cover" src="" alt="Album Cover">
        <div class="song-info">
            <div id="song-name">Song Name</div>
            <div id="singer-name">Singer Name</div>
        </div>
        <div class="controls">
            <button class="control-button" id="prev-button">⏮</button>
            <button class="control-button" id="play-button">▶️</button>
            <button class="control-button" id="next-button">⏭</button>
        </div>
        <div class="time-container">
            <div id="current-time">0:00</div>
            <div class="progress">
                <input type="range" id="progress-bar" min="0" max="100" step="1">
            </div>
            <div id="total-time">0:00</div>
        </div>
        <div id="current-lyric"></div>
        <div class="volume">
            <label for="volume-slider">音量</label>
            <input type="range" id="volume-slider" min="0" max="1" step="0.01">
        </div>
        <div class="play-mode" id="play-mode">🔁</div>
        <button class="lyrics" id="lyrics-button">显示歌词</button>
    </div>

    <!-- 歌词弹窗 -->
    <div id="lyrics-modal">
        <div id="close-lyrics">关闭</div>
        <div id="lyrics-content">歌词内容</div>
    </div>

    <!-- 页脚 -->
    <footer class="footer">
        <div class="container">
            <p>&copy; 2024 Music Website. All rights reserved.</p>
        </div>
    </footer>

    <script src="{{ url_for('static', filename='search.js') }}" defer></script>

</body>
</html>
